home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Sample Code / Snippets / Sound / SndPlayDoubleBuffer / _headers / AIFF.h next >
Encoding:
C/C++ Source or Header  |  1996-11-15  |  2.2 KB  |  86 lines  |  [TEXT/CWIE]

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    Headers for routines demonstrating how to parse an AIFF sound header.
  5. **
  6. **    by Mark Cookson, Apple Developer Technical Support
  7. **
  8. **    File:    AIFF.h
  9. **
  10. **    Copyright ©1996 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "Apple Sample
  17. **    Code" after having made changes. If you're going to re-distribute the
  18. **    source, we require that you make it clear in the source that the code
  19. **    was descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #ifndef __MyAIFF__
  23. #define __MyAIFF__
  24.  
  25. #include <AIFF.h>
  26. #include <Errors.h>
  27. #include <Files.h>
  28. #include <Sound.h>
  29.  
  30. #ifndef __DBFFERRORS__
  31. #include "DBFF_Errors.h"
  32. #endif
  33.  
  34. #ifndef __SETUPDBHEADER__
  35. #include "SetupDBHeader.h"
  36. #endif
  37.  
  38. #ifndef __LDANDFIX__
  39. #include "LDandFix.h"
  40. #endif
  41.  
  42. #ifndef __DEFINES__
  43. #include "Defines.h"
  44. #endif
  45.  
  46. #define kChunkBufferSize     128
  47. #define kChunkHeaderSize    8
  48.  
  49. /* these are bit positions for a long flag */
  50. #define kFORM                    (1<<0)
  51. #define kFormatVersion            (1<<1)
  52. #define kCommon                    (1<<2)
  53. #define kSoundData                (1<<3)
  54. #define kMarker                    (1<<4)
  55. #define kInstrument                (1<<5)
  56. #define kMIDIData                (1<<6)
  57. #define kAudioRecording            (1<<7)
  58. #define kApplicationSpecific    (1<<8)
  59. #define kComment                (1<<9)
  60. #define kName                    (1<<10)
  61. #define kAuthor                    (1<<12)
  62. #define kCopyright                (1<<13)
  63. #define kAnnotation                (1<<14)
  64.  
  65. typedef union {
  66.     ChunkHeader                    generic;
  67.     ContainerChunk                container;
  68.     FormatVersionChunk            formatVersion;
  69.     CommonChunk                    common;
  70.     ExtCommonChunk                extCommon;
  71.     SoundDataChunk                soundData;
  72.     MarkerChunk                    marker;
  73.     InstrumentChunk                instrument;
  74.     MIDIDataChunk                midiData;
  75.     AudioRecordingChunk            audioRecording;
  76.     CommentsChunk                comments;
  77.     TextChunk                    text;
  78. } ChunkTemplate, *ChunkTemplatePtr;
  79.  
  80. #define stillMoreDataToRead        ((chunkFlags & kFORM) && (!(chunkFlags & kCommon) || !(chunkFlags & kSoundData)) && (err == noErr))
  81.  
  82. OSErr    ASoundGetAIFFHeader        (SoundInfoPtr theSoundInfo,
  83.                                 long *dataStart,
  84.                                 long *length);
  85.  
  86. #endif